package datatypes.kdTree;

import datatypes.Edge;
import datatypes.Vertex;

public class EdgeContainsVertexCondition implements Condition {
	public Edge edge;
	
	public EdgeContainsVertexCondition(Edge edge) {
		this.edge = edge;
	}
	
	
	@Override
	public boolean satisfiedBy(Vertex vertex) {
		if (vertex.isOnEdge(edge, 0.00001)) {
			return ! edge.hasVertex(vertex);
		}
		return false;
	}
	
	public void setEdge(Edge edge) {
		this.edge = edge;
	}
	
}
